#!/usr/bin/env python2.6
import sys
import sqlite3

def main():
    print("--------------")
    conn = sqlite3.connect('/tmp/mydb')
    c = conn.cursor()

    # Create table
    tableName = 'results'
    #c.execute('''create table %s (guid text, datatype integer, data blob)''' % tableName)

    # Insert row
    #t = ('1234', 7, 'test data 3')
    #c.execute('insert into results values (?, ?, ?)', t)

    # Save (commit) changes
    #conn.commit()

    print "===== results table ====="
    c.execute('select * from results order by guid')
    for row in c:
        print row
    print "========================="

    c.execute('select * from results where guid="1234"')
    for row in c:
        print row

    # Closing cursor (if we're done with it)
    c.close()

    print("----DONE------")

if __name__ == '__main__':
    main()
